import Vue from 'vue';
import App from './App';
import store from './store';
import { addPrototype } from './utils/vuePrototype.js';
import * as filters from './utils/filter.js';
// import uView from 'uview-ui';
// Vue.use(uView);

// Vue原型挂在方法
addPrototype(Vue);

Vue.config.productionTip = false;

// 路由跳转 创建弹层禁止点击其他内容 防止意外发生
// #ifdef APP-PLUS
let screenWidth = 0;
let view = null;
uni.getSystemInfo({
	success(res) {
		screenWidth = res.screenWidth;
		view = new plus.nativeObj.View('test',
			{bottom:'0',left:'0',height:'100%',width: screenWidth+ 'px', backgroundColor: "rgba(0, 0, 0, 0)"},[]);
	}
})
uni.addInterceptor('navigateTo', {
	invoke() {
		view.show();
	},
	success() {
		view.hide();
	}
})
// #endif

Object.keys(filters).forEach(key => { // 过滤器
  Vue.filter(key, filters[key]);
});

App.mpType = 'app';

const app = new Vue({
	store,
  ...App
})
app.$mount()
